package bupt.xixi;

import bupt.xixi.rpc.api.HelloObject;
import bupt.xixi.rpc.api.HelloService;
import bupt.xixi.spring.RpcService;
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Data
@RpcService
public class HelloServiceImpl implements HelloService {


    // 注册日志
    private static final Logger logger = LoggerFactory.getLogger(HelloServiceImpl.class);

    private Integer id;
    private String message;

    @Override
    public String hello(HelloObject object) {
        logger.info("接受到{}", object.getMessage());
        return "远程方法1调用成功， 返回值id为： " + object.getId();
    }
}
